<%@ page language="java" pageEncoding="utf-8" %>
<%@ include file="/include/taglibs.jsp" %>
<script src="${path}/static/taoshunda/city/citymanager.js"></script>
<link href="${path}/static/css/public/public.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
    function city() {
        var names = $("#Name").val();
        var id = $("#isHot");
        var value = id.val();
        var parent = $("#parentId").val();
        var url =$().AbsUrlParse("/web/city/query?cityName="+names+"&isHot=" + value+"&parentId="+parent);
        var table = $("#table");
        table.bootstrapTable("refresh", {url: url});
    }
</script>
<style>
    #addCity {
        background: #3c8dbc!important;
        border-radius: 3px!important;
    }
</style>

<div>
    <div class="clearfix">
        <div class=".col-xs-2" >
            <button type="button" class="btn btn-default-button entry" id="addCity" style="float: left;color: snow">
                添加地区
            </button>
        </div>
        <div class="input-group col-xs-2" style="float: left;margin-left:5px">
            <input type="text" class="form-control entry" placeholder="请输入地区名称" name="names" id="Name">
        </div>

        <div class="input-group" style="float: left;margin-left:5px!important;">
            <div id="showa" class="input-group entry" style="float: left;">
                <select class="form-control" id="isHot" name="isHot">
                    <option value="-1">请选择</option>
                    <option value="2">普通</option>
                    <option value="1">热门</option>
                </select>
            </div>
        </div>

        <button type="button" class="btn  query_button" id="btnsearch1" onclick="city()" style="float:left;">
            <%--<span class="glyphicon glyphicon-search" aria-hidden="true"></span>--%>
            查询
        </button>
    </div>

    <div style="margin-left: 5px;margin-top:10px" class="path-title">
        <input type="hidden" id="parentId">
        <input type="hidden" id="deptPath">
        <div id="path" >
            <span class="path" data-id="0" onclick="clearPathClick(0)">首页:&nbsp;&nbsp;</span>
        </div>
    </div>
</div>


    <table id="table"
           data-toggle="table"
           data-toolbar="#toolbar"
           data-url="${path}/web/city/query"
           data-side-pagination="server"
           data-pagination="true"
           data-page-list="[5, 10, 20, 50, 100, 200]"
    >
        <thead>
        <tr>
            <th data-field="name" data-formatter="nameFormatter" data-events="operateEvents">地区名称</th>
            <th data-field="isHot" data-formatter="showTag" data-visible="false">是否热门</th>
            <th data-field="sorting" data-formatter="sortingFormatter">排序</th>
            <th data-field="created">创建时间</th>
            <th data-formatter="operateFormatter" data-events="operateEvents">操作</th>
        </tr>
        </thead>
    </table>


<div id="addCity-div" class="slidingmenu box-model box box-info">
    <div class="box-header">
        <h3 class="box-title">添加地区</h3>
    </div>
    <div class="box-body">
        <form role="form" action="${path}/web/city/saveOrUpdateCity" method="post" id="cityform">
            <input type="hidden"  class="form-control" name="parentId"  id="parent">
            <input type="hidden"  class="form-control" name="deptPath" id="dept">
            <div class="form-group">
                <label>地区名称:</label>
                <input type="text" class="form-control" name="name" value="" id="cityId">
            </div>
        </form>
    </div>
    <div class="box-footer">
        <button class="btn btn-info" data-event="submit-add">添加</button>&nbsp;<button class="btn btn-danger close-model">关闭</button>
    </div>
</div>



<div id="editCity-div" class="slidingmenu box-model box box-info">
    <div class="box-header">
        <h3 class="box-title">编辑</h3>
    </div>
    <div class="box-body">
        <form role="form" id="mergeForm" action="${path}/web/city/saveOrUpdateCity" method="post">
            <input type="hidden" name="cityId"  />
            <input type="hidden" name="parentId" />
            <div class="form-group">
                <label>地区名称:</label>
                <input type="text" class="form-control" name="name" id="city">
            </div>
        </form>
    </div>
    <div class="box-footer">
        <button class="btn btn-info" data-event="submit-edit">确定</button>&nbsp;<button class="btn btn-danger close-model">关闭</button>
    </div>
</div>


<div id="showOrderNum-div" class="slidingmenu box-model box box-info">
    <div class="box-header">
        <h3 class="box-title">修改排名顺序</h3>
    </div>
    <div class="box-body">
        <form role="form" action="/web/city/updateSorting" method="post" id="mergeOrderNum">
            <div class="form-group">
                <input type="hidden" class="form-control required" id="pid" name="id" value="">
                <input type="text" class="form-control required" id="sorting" name="sorting" value="">
            </div>
        </form>
    </div>
    <div class="box-footer">
        <button class="btn btn-info" data-event="merge-orderNum">确定</button>
        &nbsp;
        <button class="btn btn-danger close-model">关闭</button>
    </div>
</div>


